<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/theme/style.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/jquery.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/bootstrap.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/ckform.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/theme/common.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form action="{:U('User/edit')}" method="post" class="definewidth m20">
<input type="hidden" name="id" value="{$user.id}" />
    <table class="table table-bordered table-hover definewidth m10">
        <tr>
            <td width="30%" style="text-align: right;" class="tableleft">昨日转出</td>
            <td><input type="text" name="username" value="${yesterdayCard==null?0:yesterdayCard}"/></td>
        </tr>
         <tr>
            <td style="text-align: right;"  class="tableleft">累积转出</td>
            <td><input type="text" name="username" value="${totalCard==null?0:totalCard}"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft">剩余房卡</td>
            <td><input type="text" name="username" value="${user.totalCard}"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft">手机号码</td>
            <td><input type="text" name="username" value="${user.phone}"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft">注册时间</td>
            <td>
            <input type="text" name="username" value="<fmt:formatDate value="${user.createTime}" type="both"/>"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft">微信</td>
            <td><input type="text" id="outUserName" name="outUserName" value="${user.outUserId}"/> 备注：推广用，不作为绑定公众号标识</td>
        </tr>
        <tr>
            <td   class="tableleft" colspan="2">联系推广员</td>
        </tr>
       <tr>
            <td style="text-align: right;"  class="tableleft">手机号</td>
            <td><input type="text" disabled="disabled" name="realname" value="${parentUser.phone}"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft">微信</td>
            <td><input type="text" disabled="disabled" name="realname" value="${parentUser.outUserName}"/></td>
        </tr>
        <tr>
            <td style="text-align: right;"  class="tableleft"></td>
            <td>
                <button type="submit" id="usersave" class="btn btn-primary" type="button">保存</button>				 
                <!-- &nbsp;&nbsp;
                <button type="button" class="btn btn-success" name="backid" id="backid">关闭</button> -->
            </td>
        </tr>
    </table>
</form>
</body>
<script>
    $(function () {       
		$('#backid').click(function(){
				
		 });
    });
    
    
    $(function () {       
		$('#backid').click(function(){
	    	//如果是电脑跳转到弹出框 
	        parent.layer.close(parent.lindex);
		 });

		
		$('#usersave').click(function(){
			$('#usersave').attr('disabled',"true"); //添加disabled属性 
			var outUserName = $("#outUserName").val();
			$.post("${pageContext.request.contextPath}/admin/user_info_edit.html",
		            {"outUserName":outUserName},
		       function(data){
		            	var json = eval("("+data+")");
		            	$('#usersave').removeAttr("disabled");  //移除disabled属性 
						layer.alert(json.message);
						if(json.statusCode =='200'){
							//setTimeout("closewind()",2000);
						}
		      });
		 });
    });
    function closewind(){
    	parent.layer.close(parent.lindex);
    }
    
</script>
</html>